package com.wish.finance.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wish.common.core.web.domain.AjaxResult;
import com.wish.finance.entity.CwReceiptPlan;
import com.wish.finance.entity.vo.CwReceiptPlanVo;
import com.wish.finance.service.ICwReceiptPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 收款计划表 前端控制器
 * </p>
 *
 * @author 
 * @since 2022-03-30
 */
@RestController
@RequestMapping("/cw-receipt-plan")
public class CwReceiptPlanController {

    @Autowired
    ICwReceiptPlanService cwReceiptPlanService;
    //收款计划模糊查询及列表展示
    @PostMapping("list")
    public AjaxResult list(@RequestBody CwReceiptPlanVo cwReceiptPlanVo){
       IPage<CwReceiptPlan> pg =  cwReceiptPlanService.listShow(cwReceiptPlanVo);
        return AjaxResult.success(pg);
    }

    //收款计划数据查询
    @PostMapping("sumList")
    public AjaxResult sumList(@RequestBody CwReceiptPlanVo cwReceiptPlanVo){
        CwReceiptPlanVo cwReceiptPlanVo1 = cwReceiptPlanService.sumList(cwReceiptPlanVo);
        System.out.println(cwReceiptPlanVo1);
        return AjaxResult.success(cwReceiptPlanVo1);
    }

}
